<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"
	import="com.service.SysManager,com.beans.Adv,com.vo.Site,org.springframework.web.context.support.WebApplicationContextUtils;"%>
<%
	if (session.getAttribute("admin")!=null&&application.getAttribute("site") == null) {
		application.removeAttribute("site");
		Site site = (Site) application.getAttribute("site");
		site = Site.getInstance();
		org.springframework.web.context.WebApplicationContext wac = null;
		try {
			wac = WebApplicationContextUtils
					.getRequiredWebApplicationContext(this
							.getServletContext());
		} catch (Exception e) {
			e.printStackTrace();
			wac = WebApplicationContextUtils
					.getRequiredWebApplicationContext(getServletConfig()
							.getServletContext());
		}
		SysManager sys = (SysManager) wac.getBean("sysManager");
		site.setMenu(sys.getMenuDao().getMenuList());
		com.beans.Site s = (com.beans.Site) sys.getMenuDao().findAll(
				com.beans.Site.class).get(0);
		site.setAddress(s.getAddress());
		site.setCopyright(s.getCopyright());
		site.setDescription(s.getDescription());
		site.setKeywords(s.getKeywords());
		site.setLogo(s.getLogo());
		site.setName(s.getName());
		site.setAdvList(sys.getMenuDao().findAll(Adv.class));
		site.init();
		application.setAttribute(com.util.Const.ADMIN_URL, sys
				.getAdminDao().getUrl());
		application.setAttribute("site", site);
	}
%>